<?php

namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\Model as BaseModel;

class Model extends BaseModel
{
    use HasDateTimeFormatter;

    public function scopeEnable($query)
    {
        return $query->where('is_enable', 1);
    }

    public function scopeSort($query)
    {
        return $query->orderByDesc('sort')->orderByDesc('updated_at');
    }
}
